function Matrix() {

    this._11 = 0.0;
    this._12 = 0.0;
    this._13 = 0.0;

    this._21 = 0.0;
    this._22 = 0.0;
    this._23 = 0.0;

    this._31 = 0.0;
    this._32 = 0.0;
    this._33 = 0.0;

    this.identity = function() {
        this._11 = 1.0;
        this._12 = 0.0;
        this._13 = 0.0;

        this._21 = 0.0;
        this._22 = 1.0;
        this._23 = 0.0;

        this._31 = 0.0;
        this._32 = 0.0;
        this._33 = 1.0;
    };

    this.translation = function(x, y) {
        this.identity();

        this._13 = x;
        this._23 = y;
    };

    this.rotation = function(angle) {
        this.identity();

        this._11 = Math.cos(angle)
        this._12 = -Math.sin(angle)

        this._21 = Math.sin(angle)
        this._22 = Math.cos(angle)
    };

    this.multiply = function(m) {
        var r = new Matrix();
        r._11 = this._11 * m._11 + this._12 * m._21 + this._13 * m._31;
        r._12 = this._11 * m._12 + this._12 * m._22 + this._13 * m._32;
        r._13 = this._11 * m._13 + this._12 * m._23 + this._13 * m._33;

        r._21 = this._21 * m._11 + this._22 * m._21 + this._23 * m._31;
        r._22 = this._21 * m._12 + this._22 * m._22 + this._23 * m._32;
        r._23 = this._21 * m._13 + this._22 * m._23 + this._23 * m._33;

        r._31 = this._31 * m._11 + this._32 * m._21 + this._33 * m._31;
        r._32 = this._31 * m._12 + this._32 * m._22 + this._33 * m._32;
        r._33 = this._31 * m._13 + this._32 * m._23 + this._33 * m._33;

        return r;
    };

    this.mulV = function(v) {
        var r = new Vector(0, 0);
        r.x = this._11 * v.x + this._12 * v.y + this._13 * 1;
        r.y = this._21 * v.x + this._22 * v.y + this._23 * 1;
        return r;
    };
}